/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { ResponseItem, responseSuccess } from '../utils';
import Mock, { mock } from 'mockjs';

export default {
  'POST /Inn/getPhoneWhiteList': (req: Request, res: Response) => {
    const result: ResponseItem = Mock.mock({
      code: 0,
      msg: '成功',
      data: {
        'list|1-30': [
          {
            id: '@id',
            user_id: '@id',
            phone: '@phone',
            inn_name: '@cname',
            concat_phone: '@phone',
            operator: '@cname',
            create_at: '@now',
          },
        ],
      },
    });
    return res.json(result);
  },
  'POST /Inn/searchPhoneWhiteList': (req: Request, res: Response) => {
    return res.json(
      Mock.mock({
        code: 0,
        data: {
          cm_id: '@id',
          phone: '@phone',
          inn_name: '@cname' + '驿站',
          contact_phone: '@phone',
        },
        msg: 'success',
      }),
    );
  },
  'POST /Inn/addPhoneWhiteList': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/deletePhoneWhiteList': (req: Request, res: Response) => responseSuccess(req, res),
};
